package com.ttc.group2.videochat.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.widget.ListView;

import com.ttc.group2.videochat.R;
import com.ttc.group2.videochat.adapter.RecentListAdapter;

public class RecentFragment extends Fragment {

	private ListView lvRecent;
	private RecentListAdapter mAdapter;
	private ViewStub emptyView;

	private RecentFragment() {
	};

	public static RecentFragment newIntance() {
		RecentFragment recentFragment = new RecentFragment();
		return recentFragment;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater
				.inflate(R.layout.fragment_recent, container, false);
		initView(view);
		// lvRecent.setAdapter(mAdapter);

		// set empty view
		lvRecent.setEmptyView(emptyView);
		return view;
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);

	}

	private void initView(View view) {
		lvRecent = (ListView) view.findViewById(R.id.lvRecent);
		emptyView = (ViewStub) view.findViewById(R.id.recent_empty);
		emptyView.setLayoutResource(R.layout.recent_empty_view);
		emptyView.inflate();
	}

}
